<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<script
	src="${pageContext.request.contextPath}/resources/js/Account/Edit.js"></script>
<div id="content" class="span10">
	<!-- content starts -->

	<div>
		<ul class="breadcrumb">
			<li><a href="#">Home</a> <span class="divider">/</span></li>
			<li><a href="#">Account</a> <span class="divider">/</span></li>
			<li><a href="#">Edit Account</a></li>
		</ul>
	</div>

	<div class="row-fluid sortable">
		<div class="box span12">
			<div class="box-header well" data-original-title>
				<h2>
					<fmt:message key="form.editAccount.title" />
				</h2>
				<div class="box-icon">
					<a href="#" class="btn btn-minimize btn-round"><i
						class="icon-chevron-up"></i></a>
				</div>
			</div>
			<div class="box-content">

				<div id="formsContent">
					<!-- Form container -->
					<form:form id="accountForm" commandName="accountDTO"
						class="form-horizontal" autocomplete="off" method="POST"
						action="newAccount">
						<form:hidden path="id" id="accountId" value="${id}" />
						<div class="row-fluid">
							<div class="span12">
								<fieldset>
									<legend>
										<fmt:message key="form.account.RequiredInformation" />
									</legend>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.AccountName" /> <span
													style="color: red;">*</span></label>
												<div class="controls">
													<form:input path="accountName" id="accountName"
														name="accountName" value="" maxlength="100" placeholder=""
														class="required" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.CompanyName" /> <span
													style="color: red;">*</span></label>
												<div class="controls">
													<form:input path="companyName" id="companyName"
														name="companyName" value="" maxlength="100" placeholder=""
														class="required" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input" class="required"><fmt:message
														key="form.account.Phone" /><span style="color: red;">*</span>
												</label>
												<div class="controls">
													<form:input path="phone" id="phone" name="phone" value=""
														maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Mobile" /></label>
												<div class="controls">
													<form:input path="mobile" id="mobile" name="mobile"
														value="" maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
								</fieldset>

								<fieldset>
									<legend>
										<fmt:message key="form.account.AccountInformation" />
									</legend>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Email" /></label>
												<div class="controls">
													<form:input path="email" id="email" name="email" value=""
														maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Fax" /> <span style="color: red;">*</span></label>
												<div class="controls">
													<form:input path="fax" id="fax" name="fax" value=""
														maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
								</fieldset>
								<fieldset>
									<legend>
										<fmt:message key="form.lead.addressinformation" />
									</legend>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Street" /></label>
												<div class="controls">
													<form:input path="street" id="street" name="street"
														value="" maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.ZipCode" /></label>
												<div class="controls">
													<form:input path="zipCode" id="zipCode" name="zipCode"
														value="" maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.City" /></label>
												<div class="controls">
													<form:select path="city.id" id="city" name="city">
														<option value="0">--none--</option>
														<c:forEach items="${cities}" var="city">
															<form:option value="${city.id}">${city.name}</form:option>
														</c:forEach>
													</form:select>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Country" /></label>
												<div class="controls">
													<form:select path="country.id" id="country" name="country"
														onchange="getAjaxCities();">
														<c:forEach items="${countries}" var="country">
															<c:choose>
																<c:when test="${country.id == accountDTO.country.id}">
																	<option value="${country.id}" selected="selected">${country.countryName}</option>
																</c:when>
																<c:otherwise>
																	<option value="${country.id}">${country.countryName}</option>
																</c:otherwise>
															</c:choose>
														</c:forEach>
													</form:select>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Area" /></label>
												<div class="controls">
													<form:input path="state" id="area" name="area" value=""
														maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Website" /></label>
												<div class="controls">
													<form:input path="webSite" id="website" name="website"
														value="" maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
								</fieldset>

								<fieldset>
									<legend>
										<fmt:message key="form.account.AdditionalInformation" />
									</legend>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.EmpNum" /></label>
												<div class="controls">
													<form:input path="empNum" id="empNum" name="empNum"
														value="" maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Type" /></label>
												<div class="controls">
													<form:select path="type" id="type" name="type">
														<c:forEach items="${types}" varStatus="type">
															<option value="${type.index}"
																${types[type.index].name == accountDTO.type ? 'selected' : ''}>${types[type.index].name}</option>
														</c:forEach>
													</form:select>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.AnnualRevenue" /></label>
												<div class="controls">
													<form:input path="annualRevenue" id="annualRevenue"
														name="annualRevenue" value="" maxlength="100"
														placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Industry" /></label>
												<div class="controls">
													<form:select path="industry" id="industry" name="industry">
														<c:forEach items="${industries}" varStatus="industry">
															<option value="${industry.index}"
																${industries[industry.index].name == accountDTO.industry ? 'selected' : ''}>${industries[industry.index].name}</option>
														</c:forEach>
													</form:select>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span12 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input"><fmt:message
														key="form.account.Description" /></label>
												<div class="controls">
													<form:textarea path="description" rows="5"
														class="input-xxlarge" id="description" name="description"></form:textarea>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
								</fieldset>
							</div>
						</div>
						<div class="form-actions">
							<button id="saveButton" type="submit" class="btn btn-primary">
								<fmt:message key="form.editaccount.btnEdit" />
							</button>
							<button id="cancelButton" type="button" class="btn">
								<fmt:message key="form.cancel" />
							</button>
						</div>
					</form:form>
				</div>

			</div>
		</div>
		<!--/span-->

	</div>
	<!--/row-->
	<input type="hidden" name="fNameRequired" id="fNameRequired"
		value="<fmt:message key="error.lead.fName"/>" /> <input type="hidden"
		name="companyRequired" id="companyRequired"
		value="<fmt:message key="error.lead.company"/>" /> <input
		type="hidden" name="companyChecked" id="companyChecked"
		value="<fmt:message key="error.lead.checkCompany"/>" /> <input
		type="hidden" name="phoneRequired" id="phoneRequired"
		value="<fmt:message key="error.lead.phone"/>" /> <input type="hidden"
		name="phoneChecked" id="phoneChecked"
		value="<fmt:message key="error.lead.phoneChecked"/>" /> <input
		type="hidden" name="emailEmail" id="emailEmail"
		value="<fmt:message key="error.lead.emailPattern"/>" />
	<!-- content ends -->
</div>
<!--/#content.span10-->
<hr />